package file.day9_18.day03;

import java.io.Serializable;
import java.util.Arrays;

public class Person implements Serializable {//进行序列化的类必须实现接口:java.io.Serializable
    //transient关键字可以修饰属性，用于在进行对象序列化时忽略不必要的属性，达到对象瘦身的目的
    public static final long serialVersionUID = 1L;//进行序列化标记
    private String name,gender;
    private int age;
    private String[] otherInfo;

    public Person(String name, String gender, int age, String[] otherInfo) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.otherInfo = otherInfo;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public int getAge() {
        return age;
    }

    public String[] getOtherInfo() {
        return otherInfo;
    }

    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}
